﻿using System;


namespace MyProFile_V2.Model
{
    public class DataModel
    {
        #region 共同属性
        //表名首字母小写
        private string lTableName;
        public string LTableName
        {
            get { return lTableName; }
            set { lTableName = value; }
        }
        //表名首字母大写
        private string uTableName;
        public string UTableName
        {
            get { return uTableName; }
            set { uTableName = value; }
        }
        //主键类型
        private string pK_type;
        public string PK_type
        {
            get { return pK_type; }
            set { pK_type = value; }
        }
        //是否为视图
        private bool isView;
        public bool IsView
        {
            get { return isView; }
            set { isView = value; }
        }
        //是否按架构分文件夹
        private bool isFolderBySchema;

        public bool IsFolderBySchema
        {
            get { return isFolderBySchema; }
            set { isFolderBySchema = value; }
        }
        //该表位于哪个文件夹下面 ，如果为空则没有
        private string parentFloder;
        public string ParentFloder
        {
            get { return parentFloder; }
            set { parentFloder = value; }
        }
        #endregion

        #region 模型属性Model
        //属性模板
        private string columnsProper;
        public string ColumnsProper
        {
            get { return columnsProper; }
            set { columnsProper = value; }
        }
        //对 model层的类描述
        private string tabDes;
        public string TabDes
        {
            get { return tabDes; }
            set { tabDes = value; }
        }
        //注释
        private string annotationDefModel;
        public string AnnotationDefModel
        {
            get { return annotationDefModel; }
            set { annotationDefModel = value; }
        }
        //命名空间
        private string nameSpaceDefModel;
        public string NameSpaceDefModel
        {
            get { return nameSpaceDefModel; }
            set { nameSpaceDefModel = value; }
        }
        //自定义代码
        private string defCodeModel;
        public string DefCodeModel
        {
            get { return defCodeModel; }
            set { defCodeModel = value; }
        }

        #endregion

        #region 业务属性Bll
        //注释
        private string annotationDefBll;
        public string AnnotationDefBll
        {
            get { return annotationDefBll; }
            set { annotationDefBll = value; }
        }
        //命名空间
        private string nameSpaceDefBll;
        public string NameSpaceDefBll
        {
            get { return nameSpaceDefBll; }
            set { nameSpaceDefBll = value; }
        }
        //自定义代码
        private string defCodeBll;
        public string DefCodeBll
        {
            get { return defCodeBll; }
            set { defCodeBll = value; }
        }

        #endregion

        #region 工厂属性Factory
        //注释
        private string annotationDefFac;
        public string AnnotationDefFac
        {
            get { return annotationDefFac; }
            set { annotationDefFac = value; }
        }
        //命名空间
        private string nameSpaceDefFac;
        public string NameSpaceDefFac
        {
            get { return nameSpaceDefFac; }
            set { nameSpaceDefFac = value; }
        }
        //自定义代码
        private string defCodeFac;
        public string DefCodeFac
        {
            get { return defCodeFac; }
            set { defCodeFac = value; }
        }


        #endregion

        #region 数据层属性Dal
        //注释
        private string annotationDefDal;
        public string AnnotationDefDal
        {
            get { return annotationDefDal; }
            set { annotationDefDal = value; }
        }
        //命名空间
        private string nameSpaceDefDal;
        public string NameSpaceDefDal
        {
            get { return nameSpaceDefDal; }
            set { nameSpaceDefDal = value; }
        }
        //自定义代码
        private string defCodeDal;

        public string DefCodeDal
        {
            get { return defCodeDal; }
            set { defCodeDal = value; }
        }


        private string columns;
        public string Columns
        {
            get { return columns; }
            set { columns = value; }
        }

        private string columns2;
        public string Columns2
        {
            get { return columns2; }
            set { columns2 = value; }
        }

        private string paramsContext;
        public string ParamsContext
        {
            get { return paramsContext; }
            set { paramsContext = value; }
        }
        // 主键
        private string pK;
        public string PK
        {
            get { return pK; }
            set { pK = value; }
        }
        //更新参数
        private string updateParamsContext;
        public string UpdateParamsContext
        {
            get { return updateParamsContext; }
            set { updateParamsContext = value; }
        }

        private string updateColumns;
        public string UpdateColumns
        {
            get { return updateColumns; }
            set { updateColumns = value; }
        }

        private string whereParamsContext;
        public string WhereParamsContext
        {
            get { return whereParamsContext; }
            set { whereParamsContext = value; }
        }

        private string whereUpdateColumns;
        public string WhereUpdateColumns
        {
            get { return whereUpdateColumns; }
            set { whereUpdateColumns = value; }
        }

        private string selectOneForeachContext;
        public string SelectOneForeachContext
        {
            get { return selectOneForeachContext; }
            set { selectOneForeachContext = value; }
        }

        private string selectAllForeachContext;
        public string SelectAllForeachContext
        {
            get { return selectAllForeachContext; }
            set { selectAllForeachContext = value; }
        }

        private string selectPagesForeachContext;
        public string SelectPagesForeachContext
        {
            get { return selectPagesForeachContext; }
            set { selectPagesForeachContext = value; }
        }
        //数据层的模版
        private string dalMoban;
        public string DalMoban
        {
            get { return dalMoban; }
            set { dalMoban = value; }
        }

       
        private string selectAllColumns;

        public string SelectAllColumns
        {
            get { return selectAllColumns; }
            set
            {
                if(!string.IsNullOrEmpty(value))
                {//驱除前后逗号
                    string str = value;
                    if(value.StartsWith(","))
                    {
                        str=str.Substring(1);
                    }
                    if(value.EndsWith(","))
                    {
                        str=str.Substring(0, str.Length - 1);
                    }
                    selectAllColumns = str;
                }
            }
        }

        //private string defCodeBll;
        //public string DefCodeBll
        //{
        //    get { return defCodeBll; }
        //    set { defCodeBll = value; }
        //}

        //private string defCodeModel;
        //public string DefCodeModel
        //{
        //    get { return defCodeModel; }
        //    set { defCodeModel = value; }
        //}

        //private string defCodeDal;
        //public string DefCodeDal
        //{
        //    get { return defCodeDal; }
        //    set { defCodeDal = value; }
        //}

        //private string defCodeFactory;
        //public string DefCodeFactory
        //{
        //    get { return defCodeFactory; }
        //    set { defCodeFactory = value; }
        //}

        #endregion



    }
}
